package main

import "fmt"

type PayStrategy02 interface {
	Pay() // 支付
}

type AliPay02 struct {
}

func (a AliPay02) Pay() {
	fmt.Println("支付宝支付...")
}

type WechatPay02 struct {
}

func (w WechatPay02) Pay() {
	fmt.Println("微信支付...")
}

type PayStrategy02Context struct {
	payStrategy PayStrategy02
}

func main() {
	p1 := PayStrategy02Context{
		payStrategy: AliPay02{},
	}
	p1.payStrategy.Pay()

	p2 := PayStrategy02Context{
		payStrategy: WechatPay02{},
	}
	p2.payStrategy.Pay()
}
